﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using EuphoricNation.Util;

public partial class masters_Default : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        FooterDate.Text = DateTime.Now.ToString("yyyy");

        UpdateLoginControls();
    }

    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (Page.Title != "INDEX")
            Page.Title = string.Format("EuphoricNation: {0}", Page.Title);
        else
            Page.Title = "Welcome To EuphoricNation";
    }

    private void UpdateLoginControls()
    {
        accountlinks.Visible = Authentication.UserLoggedIn;
        LoginPanel.Visible = !Authentication.UserLoggedIn;
        AccountPanel.Visible = Authentication.UserLoggedIn;
    }

    protected void LogoutBtn_Click(object sender, EventArgs e)
    {
        Authentication.Logout();
    }
}
